package com.hdd.biz.account.service;

import com.hdd.biz.account.entity.Account;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;
import java.util.Map;

/**
 * <p>
 * 账户表 服务类
 * </p>
 *
 * @author fang
 * @since 2021-02-23
 */
public interface AccountService extends IService<Account> {



    Account findAccount(String userId);

    /**
     * 创建账户
     * @param userId
     * @return
     */
    boolean createAccount(String userId);

    /**
     * 添加余额
     * @param id
     * @param amount
     * @return
     */
    boolean increBlance(String id,BigDecimal amount);

    /**
     * 减少余额
     * @param id
     * @param amount
     * @return
     */
    boolean reduceBlance(String id,BigDecimal amount);

    /**
     * 添加收益
     * @param id
     * @param amount
     * @return
     */
    boolean increaseIncome(String id,BigDecimal amount);

    /**
     * 添加增加冻结金额
     * @param id
     * @param amount
     * @return
     */
    boolean increaseFrozen(String id,BigDecimal amount);

    /**
     * 减少冻结金额
     * @param id
     * @param amount
     * @return
     */
    boolean reduceFrozen(String id,BigDecimal amount);

    /**
     * 提现
     * @param id
     * @param userId
     * @param amount
     * @param platforms
     * @param account
     * @param real_name
     * @return
     */
    boolean withdraw(String id,String userId,String amount,String platforms,String account,String real_name);

}
